package com.museum;

import com.museum.model.Place;
import com.museum.model.Visited;
import com.museum.R;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.view.View.OnClickListener;

public class MainActivity extends Activity {
	EditText txtUsername;
	EditText txtPassword;
	Button btnLogin;

	Visited visited;
	Place place;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        
        bindWidget();
        setButtonEventListener();
    }
    private void bindWidget(){
    	txtUsername = (EditText) findViewById(R.id.txtUsername);
    	txtPassword = (EditText) findViewById(R.id.txtPassword);
    	btnLogin = (Button) findViewById(R.id.btnLogin);
    	
    	txtUsername.setText("test");
    	txtPassword.setText("testpwd");
    }
    private void setButtonEventListener(){
    	btnLogin.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intent = new Intent(getApplicationContext(), Dashboard.class); 
				startActivity(intent);
				
				overridePendingTransition(R.anim.slide_in_right, R.anim.slide_in_left); 
			}
		});   	
    	
    }
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }
}
